package com.credithc.signature.job.po;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@NoArgsConstructor
@Data
public class CanalPo {

    @JsonProperty("data")
    private List<DataDTO> data;

    @JsonProperty("database")
    private String database;

    @JsonProperty("id")
    private Integer id;

    @JsonProperty("old")
    private List<OldDTO> old;

    @JsonProperty("pkNames")
    private List<String> pkNames;

    @JsonProperty("sql")
    private String sql;

    @JsonProperty("table")
    private String table;

    @JsonProperty("type")
    private String type;

    @NoArgsConstructor
    @Data
    public static class DataDTO {
        @JsonProperty("id")
        private String id;
        @JsonProperty("request_sn")
        private String requestSn;
        @JsonProperty("template_no")
        private String templateNo;
        @JsonProperty("channel_no")
        private String channelNo;
        @JsonProperty("encrypt_key")
        private String encryptKey;
        @JsonProperty("sign_status")
        private String signStatus;
        @JsonProperty("is_seal")
        private String isSeal;
        @JsonProperty("callback_url")
        private String callbackUrl;
        @JsonProperty("ref_id")
        private Long refId;
        @JsonProperty("success_call_msg")
        private String successCallMsg;
        @JsonProperty("upload_pdf_status")
        private String uploadPdfStatus;
        @JsonProperty("generate_pdf_status")
        private String generatePdfStatus;
        @JsonProperty("mq_send_status")
        private String mqSendStatus;
        @JsonProperty("fail_call_num")
        private String failCallNum;
        @JsonProperty("success_call_code")
        private Object successCallCode;
        @JsonProperty("personal_seal_num")
        private String personalSealNum;
        @JsonProperty("official_seal_num")
        private String officialSealNum;
        @JsonProperty("contract_uri")
        private String contractUri;
        @JsonProperty("create_time")
        private String createTime;
        @JsonProperty("update_time")
        private String updateTime;
        @JsonProperty("last_time")
        private String lastTime;
        @JsonProperty("sign_result")
        private String signResult;
        @JsonProperty("third_party_channel")
        private String thirdPartyChannel;
    }

    @NoArgsConstructor
    @Data
    public static class OldDTO {
        @JsonProperty("sign_status")
        private String signStatus;
    }
}
